home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "ListEx Demo"
- ClientHeight = 5700
- ClientLeft = 240
- ClientTop = 540
- ClientWidth = 9285
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 6105
- Left = 180
- LinkTopic = "Form1"
- ScaleHeight = 380
- ScaleMode = 3 'Pixel
- ScaleWidth = 619
- Top = 195
- Width = 9405
- Begin VB.CommandButton Cmd_Exit
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "E&xit"
- Height = 375
- Left = 5520
- TabIndex = 10
- Top = 5160
- Width = 975
- End
- Begin VB.DirListBox Dir1
- Appearance = 0 'Flat
- Height = 930
- Left = 6720
- TabIndex = 8
- Top = 3720
- Width = 2295
- End
- Begin VB.FileListBox File1
- Appearance = 0 'Flat
- Height = 420
- Index = 1
- Left = 3000
- Pattern = "*.ico"
- TabIndex = 7
- Top = 5160
- Visible = 0 'False
- Width = 975
- End
- Begin VB.CommandButton Cmd_Add
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "Add Lines"
- Height = 375
- Left = 1560
- TabIndex = 6
- Top = 2760
- Width = 1215
- End
- Begin VB.FileListBox File1
- Appearance = 0 'Flat
- Height = 420
- Index = 0
- Left = 1920
- TabIndex = 1
- Top = 5160
- Visible = 0 'False
- Width = 975
- End
- Begin VB.CommandButton Cmd_Load
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "Load Files"
- Height = 375
- Left = 240
- TabIndex = 0
- Top = 2760
- Width = 1215
- End
- Begin ListExLib.ListEx ListEx4
- Height = 1455
- Left = 2040
- TabIndex = 14
- Top = 3480
- Width = 4335
- _Version = 65536
- _ExtentX = 7646
- _ExtentY = 2566
- _StockProps = 237
- ForeColor = 0
- BackColor = 16777215
- BorderStyle = 1
- Appearance = 1
- ItemDefHeight = 16
- ImageOffset = 0
- TextOffset = 0
- SelectStyle = 0 'False
- NumTabs = 0
- Columns = 0
- MultiSelect = 0
- Sorted = 0 'False
- VerticalTextAlign= 1
- VerticalImageAlign= 1
- IntegralHeight = 0 'False
- End
- Begin ListExLib.ListEx ListEx3
- Height = 1455
- Left = 240
- TabIndex = 13
- Top = 3480
- Width = 1455
- _Version = 65536
- _ExtentX = 2566
- _ExtentY = 2566
- _StockProps = 237
- ForeColor = 0
- BackColor = 16777215
- BorderStyle = 1
- Appearance = 1
- ItemDefHeight = 16
- ImageOffset = 0
- TextOffset = 0
- SelectStyle = -1 'True
- NumTabs = 0
- Columns = 0
- MultiSelect = 0
- Sorted = 0 'False
- VerticalTextAlign= 1
- VerticalImageAlign= 1
- IntegralHeight = 0 'False
- End
- Begin ListExLib.ListEx ListEx2
- Height = 765
- Left = 6840
- TabIndex = 12
- Top = 4680
- Width = 2010
- _Version = 65536
- _ExtentX = 3545
- _ExtentY = 1349
- _StockProps = 237
- ForeColor = 0
- BackColor = 16777215
- BorderStyle = 1
- Appearance = 1
- ItemDefHeight = 32
- ImageOffset = 0
- TextOffset = 0
- SelectStyle = 0 'False
- NumTabs = 0
- Columns = 4
- MultiSelect = 0
- Sorted = 0 'False
- VerticalTextAlign= 0
- VerticalImageAlign= 0
- IntegralHeight = 0 'False
- End
- Begin ListExLib.ListEx ListEx1
- Height = 2175
- Left = 240
- TabIndex = 11
- Top = 540
- Width = 8775
- _Version = 65536
- _ExtentX = 15478
- _ExtentY = 3836
- _StockProps = 237
- ForeColor = 0
- BackColor = 16777215
- BorderStyle = 1
- Appearance = 1
- ItemDefHeight = 16
- ImageOffset = 0
- TextOffset = 0
- SelectStyle = 0 'False
- NumTabs = 0
- Columns = 0
- MultiSelect = 2
- Sorted = 0 'False
- VerticalTextAlign= 1
- VerticalImageAlign= 1
- IntegralHeight = -1 'True
- End
- Begin VB.Shape Shape4
- Height = 1695
- Left = 1920
- Top = 3360
- Width = 4575
- End
- Begin VB.Image Img_Chk
- Appearance = 0 'Flat
- Height = 165
- Index = 1
- Left = 660
- Picture = "listex.frx":0000
- Top = 5280
- Visible = 0 'False
- Width = 180
- End
- Begin VB.Image Img_Chk
- Appearance = 0 'Flat
- Height = 165
- Index = 0
- Left = 360
- Picture = "listex.frx":049A
- Top = 5280
- Visible = 0 'False
- Width = 180
- End
- Begin VB.Shape Shape3
- Height = 1695
- Left = 120
- Top = 3360
- Width = 1695
- End
- Begin VB.Shape Shape2
- BackColor = &H00C0C0C0&
- Height = 3135
- Left = 120
- Top = 120
- Width = 9015
- End
- Begin VB.Shape Shape1
- Height = 2235
- Left = 6600
- Top = 3360
- Width = 2535
- End
- Begin VB.Label Lbl_File
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "ICON Directory"
- ForeColor = &H80000008&
- Height = 255
- Index = 4
- Left = 6720
- TabIndex = 9
- Top = 3420
- Width = 2175
- End
- Begin VB.Image Img_Icons
- Appearance = 0 'Flat
- Height = 180
- Index = 2
- Left = 1560
- Picture = "listex.frx":0934
- Top = 5280
- Visible = 0 'False
- Width = 240
- End
- Begin VB.Image Img_Icons
- Appearance = 0 'Flat
- Height = 210
- Index = 0
- Left = 960
- Picture = "listex.frx":0E06
- Top = 5280
- Visible = 0 'False
- Width = 180
- End
- Begin VB.Image Img_Icons
- Appearance = 0 'Flat
- Height = 210
- Index = 1
- Left = 1260
- Picture = "listex.frx":12C0
- Top = 5280
- Visible = 0 'False
- Width = 180
- End
- Begin VB.Label Lbl_File
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "Creation Time"
- ForeColor = &H80000008&
- Height = 255
- Index = 3
- Left = 7440
- TabIndex = 5
- Top = 240
- Width = 1215
- End
- Begin VB.Label Lbl_File
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "Creation Date"
- ForeColor = &H80000008&
- Height = 255
- Index = 2
- Left = 6120
- TabIndex = 4
- Top = 240
- Width = 1215
- End
- Begin VB.Label Lbl_File
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "Size"
- ForeColor = &H80000008&
- Height = 255
- Index = 1
- Left = 4740
- TabIndex = 3
- Top = 240
- Width = 1215
- End
- Begin VB.Label Lbl_File
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "File Name"
- ForeColor = &H80000008&
- Height = 255
- Index = 0
- Left = 300
- TabIndex = 2
- Top = 240
- Width = 1215
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- DefInt A-Z
- ' LISTEX - Demo program for using the LISTEX.OCX control
- ' Joe C. Oliphant
- ' joe_oliphant@csufresno.edu
- ' CompuServe [71742,1451]
- Dim MaxWidth%
- Const LGHTGREY& = &HC0C0C0
- Const DRKGREY& = &H808080
- Private Sub Cmd_Add_Click()
- Dim I
- For I = 0 To ListEx1.ListCount - 1 Step 2
- ListEx1.ItemBackColor(I) = LGHTGREY
- If I + 1 < ListEx1.ListCount Then
- ListEx1.ItemBackColor(I + 1) = DRKGREY
- End If
- Next I
- End Sub
- Private Sub Cmd_Exit_Click()
- End
- End Sub
- Private Sub Cmd_Load_Click()
- Dim A$, I%, J%, TB$, TimeStamp$, Ext$
- TB$ = Chr$(9)
- ListEx1.Clear
- ListEx1.ImageOffset = 4
- ListEx1.TextOffset = 24
-
- For I = 0 To File1(0).ListCount - 1
- A$ = File1(0).List(I)
- TimeStamp$ = FileDateTime(A$)
- ListEx1.AddItem A$ & TB$ & Format$(FileLen(A$), "#,##0") & TB$ & Format$(TimeStamp$, "mm/dd/yy") & TB$ & Format$(TimeStamp$, "hh:mm:ss am/pm")
- J = InStr(A$, ".")
- Ext$ = ""
- If J Then Ext$ = Mid$(A$, J + 1, 3)
- Select Case Ext$
- Case "wri", "txt", "doc"
- ListEx1.ItemImage(I) = Img_Icons(1).Picture
- ListEx1.ItemForeColor(I) = QBColor(1)
- Case "bat", "com", "exe"
- ListEx1.ItemImage(I) = Img_Icons(2).Picture
- ListEx1.ItemForeColor(I) = QBColor(2)
- Case Else
- ListEx1.ItemImage(I) = Img_Icons(0).Picture
- End Select
- Next I
- End Sub
- Private Sub Dir1_Change()
- Dim I, ICOFile$
- Screen.MousePointer = 11
- File1(1).Path = Dir1.Path
- File1(1).Refresh
- ListEx2.Clear
- For I = 0 To File1(1).ListCount - 1
- ICOFile$ = Dir1.Path & "\" & File1(1).List(I)
- ListEx2.AddItem ""
- ListEx2.ItemImage(I) = LoadPicture(ICOFile$)
- Next I
- Screen.MousePointer = 0
- End Sub
- Private Sub Form_Load()
- Dim I, FntName$
- ' Set tab stops in ListEx1 (- values for right justified)
- ' Form1.ScaleMode is 3 (Pixel) to make thing easier
- ListEx1.NumTabs = 3
- ListEx1.TabStops(0) = (Lbl_File(1).Left + Lbl_File(1).Width - ListEx1.Left) * -1
- ListEx1.TabStops(1) = (Lbl_File(2).Left + Lbl_File(2).Width - ListEx1.Left) * -1
- ListEx1.TabStops(2) = (Lbl_File(3).Left + Lbl_File(3).Width - ListEx1.Left) * -1
- ListEx3.ImageOffset = Img_Chk(0).Width * 0.25
- ListEx3.TextOffset = Img_Chk(0).Width * 1.5
- ListEx3.AddItem "Check Boxes"
- ListEx3.ItemForeColor(0) = QBColor(1)
- ListEx3.SelectEnable(0) = False
- For I = 1 To 20
- ListEx3.AddItem "Check " & Format$(I)
- ListEx3.ItemImage(ListEx3.NewIndex) = Img_Chk(0).Picture
- Next I
- ListEx4.AddItem "Screen Fonts"
- ListEx4.ItemForeColor(0) = QBColor(1)
- ListEx4.SelectEnable(0) = False
- ListEx4.ItemDefHeight = 18
- For I = 1 To Screen.FontCount
- FntName$ = Screen.Fonts(I)
- If FntName$ <> "" Then
- ListEx4.AddItem FntName$
- With ListEx4.ItemFont(ListEx4.NewIndex)
- .Name = FntName$
- If I Mod 2 Then
- .Italic = True
- .Bold = False
- Else
- .Italic = False
- .Bold = True
- End If
- End With
- End If
- Next I
- End Sub
- Private Sub ListEx3_MouseUp(Button As Integer, Shift As Integer, X As Single, y As Single)
- Dim I
- I = ListEx3.ListIndex
- If I <= 0 Then Exit Sub
- If X > (Img_Chk(0).Width * 1.25) * Screen.TwipsPerPixelX Then Exit Sub
- If ListEx3.ItemData(I) Then
- ListEx3.ItemImage(I) = Img_Chk(0).Picture
- ListEx3.ItemData(I) = False
- Else
- ListEx3.ItemImage(I) = Img_Chk(1).Picture
- ListEx3.ItemData(I) = True
- End If
- End Sub
-